# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Justin Berthault <justin.berthault@zaclys.net>
pkgname=py3-iniconfig
_pyname=iniconfig
pkgver=1.1.1
pkgrel=7
pkgdesc="brain-dead simple config-ini parsing"
url="https://github.com/pytest-dev/iniconfig"
arch="noarch"
license="MIT"
makedepends="py3-gpep517 py3-setuptools py3-wheel py3-py"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/i/$_pyname/$_pyname-$pkgver.tar.gz"
options="!check" # pytest needed, circular dep
builddir="$srcdir/$_pyname-$pkgver"

prepare() {
	default_prepare

	sed -i "s|use_scm_version=True|version=\"$pkgver\"|" setup.py
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
c9341db7e3ec2204b6a674fca7824cbeb492e3576d5ac3f084b234c82842b28f2f6acbfdb812e183f4334a95b990551f942a4caf548f5ce7ef14885f931535ee  iniconfig-1.1.1.tar.gz
"
